/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.itmatter.classifier.rmi.server;

import com.enigmastation.extractors.impl.SimpleWordLister;
import com.itmatter.classifier.directdb.DBFisherClassifierImpl;
import com.itmatter.classifier.rmi.RemoteClassifierInterface;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Set;

/**
 *
 * @author Daniel.Fisla
 */
public class RemoteClassifierImpl extends UnicastRemoteObject implements RemoteClassifierInterface {
    
    private DBFisherClassifierImpl nc = null;
    
    public RemoteClassifierImpl() throws RemoteException {
        
        nc = new DBFisherClassifierImpl();
        nc.setWordLister(new SimpleWordLister());
        nc.init();
    }
    
    public String getClassification(Object item) throws RemoteException {
        
        return nc.getClassification(item);
    }
    
    public String getClassification(Object item, String defaultCat) throws RemoteException {
        
        return nc.getClassification(item, defaultCat);
    }
    
    public Double getFeatureProbability(String feature, String category) {
        
        return nc.getFeatureProbability(feature, category);
    }
    
    public Double getWeightedFeatureProbability(String feature, String category) {
        
        return nc.getWeightedFeatureProbability(feature, category);
    }
    
    public Set<String> getCategories() {
        
        return nc.getCategories();
    }
    
    public void train(Object item, String category) throws RemoteException {
        
        nc.train(item, category);
    }
    
    public void deleteAllData() throws RemoteException{
        nc.deleteAllData();
    }
}
